﻿#include "mywidget.h"
#include "ui_mywidget.h"

mywidget::mywidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::mywidget)
{
    ui->setupUi(this);

    connect(ui->Slider, &QSlider::valueChanged, this, &mywidget::setValue_slider);

    void (QSpinBox::*SpinBox)(int) = (&QSpinBox::valueChanged);
    connect(ui->spinBox, SpinBox, this, &mywidget::setValue_spinbox);
}

mywidget::~mywidget()
{
    delete ui;
}

void mywidget::setValue_spinbox(int myValue)
{
    ui->Slider->setValue(myValue);
}

void mywidget::setValue_slider(int myValue)
{

    ui->spinBox->setValue(myValue);
}
